package com.atguigu.executorpool;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @program: IDEAcode
 * @description:
 * @author: Mr.zjx
 * create: 2021-07-31-19-24
 **/
public class ClearCollection {
    public static void main(String[] args) {
        //泛型不能写基本数据类型
        Collection<Integer> coll = new ArrayList<Integer>();
        coll.add(1);
        coll.add(2);
        coll.add(3);
        System.out.println("coll = " + coll);
        boolean b = coll.contains(2);//判断是否包含指定元素
        System.out.println("b = " + b);
        boolean empty = coll.isEmpty();//集合部位空，则true
        System.out.println("empty = " + empty);
        int size = coll.size();//集合长度
        System.out.println("size = " + size);
        coll.clear();//清空数据
        System.out.println("coll = " + coll);
    }
}
